package com.weilx959.spt.app.plugin;

import com.weilx959.spt.app.controller.LogViewController;
import com.weilx959.spt.app.utils.ResourceBundleUtil;
import com.weilx959.spt.core.interfaces.Controller;
import com.weilx959.spt.core.interfaces.SPTPlugin;
import com.weilx959.spt.core.utils.FXMLUtil;
import javafx.scene.Node;

import java.util.ResourceBundle;

/**
 * Log plugin implementation
 *
 * @author weilx
 * @since 2024年6月10日
 */
public class LogPluginImpl implements SPTPlugin {
    private final LogViewController controller;

    private final ResourceBundle bundle;

    public LogPluginImpl() {
        bundle = ResourceBundleUtil.get();
        controller = FXMLUtil.getController("com/weilx959/spt/app/log-view.fxml", bundle);
    }

    @Override
    public String getID() {
        return "26ff4b1c-ef80-4b67-a622-96619f9cc22f"; // UUID
    }

    @Override
    public String getName() {
        return bundle.getString("app.log.name");
    }

    @Override
    public String getDescription() {
        return bundle.getString("app.log.description");
    }

    @Override
    public String getIconStyle() {
        return "log";
    }

    @Override
    public String getVersion() {
        return bundle.getString("app.log.version");
    }

    @Override
    public String getAuthor() {
        return bundle.getString("app.log.author");
    }

    @Override
    public Controller getController() {
        return controller;
    }

    @Override
    public Node getView() {
        return controller.getRootPane();
    }

    @Override
    public Integer getOrder() {
        return Integer.MAX_VALUE;
    }
}
